package com.fulihui.weixinclient.request.order;

import com.fulihui.weixinclient.http.HttpMethodEnum;
import com.fulihui.weixinclient.result.order.RefundWeixinResult;
import com.fulihui.weixinclient.util.XMLUtil;

/**
 * 微信退款接口请求参数
 * Created by Willard on 2015/9/17.
 */
public class RefundWeixinRequest extends OrderWeixinRequest<RefundWeixinResult> {
    private static final long serialVersionUID = -29273087093119434L;

    /* 微信订单号 与out_trade_no二选一 */
    private String            transaction_id;

    /* 商户订单号 与transaction_id二选一 */
    private String            out_trade_no;

    /* 商户退款单号 Required */
    private String            out_refund_no;

    /* 总金额 Required */
    private int               total_fee;

    /* 退款金额 Required */
    private int               refund_fee;

    /* 货币种类 */
    private String            refund_fee_type;

    /* 操作员 Required */
    private String            op_user_id;

    @Override
    protected void childParam() {
    }

    @Override
    public String service() {
        return "https://api.mch.weixin.qq.com/secapi/pay/refund";
    }

    @Override
    public String urlEndStr() {
        return null;
    }

    @Override
    public RefundWeixinResult parseResult(String respStr) {
        return XMLUtil.parseObject(respStr, RefundWeixinResult.class);
    }

    @Override
    public HttpMethodEnum httpMethod() {
        return HttpMethodEnum.CERT_SSL_POST;
    }

    @Override
    public String requestData() {
        return XMLUtil.toXMLString(this);
    }

    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getOut_refund_no() {
        return out_refund_no;
    }

    public void setOut_refund_no(String out_refund_no) {
        this.out_refund_no = out_refund_no;
    }

    public int getTotal_fee() {
        return total_fee;
    }

    public void setTotal_fee(int total_fee) {
        this.total_fee = total_fee;
    }

    public int getRefund_fee() {
        return refund_fee;
    }

    public void setRefund_fee(int refund_fee) {
        this.refund_fee = refund_fee;
    }

    public String getRefund_fee_type() {
        return refund_fee_type;
    }

    public void setRefund_fee_type(String refund_fee_type) {
        this.refund_fee_type = refund_fee_type;
    }

    public String getOp_user_id() {
        return op_user_id;
    }

    public void setOp_user_id(String op_user_id) {
        this.op_user_id = op_user_id;
    }
}
